package edu.fiu.cis.personalize.server.graph.update;

import edu.fiu.cis.personalize.server.graph.NodeType;
import edu.fiu.cis.personalize.server.graph.Query;
import edu.fiu.cis.personalize.server.graph.User;

public class QueryUserUpdate extends GraphUpdate<Query, User> {

	@Override
	protected double computeWeight(Query q, User u) {
		double numQuerySubmitted = u.getSubmitQueryCount(q);
		double average = q.getAverageUserSubmissions();
		return numQuerySubmitted/average;
	}


	@Override
	NodeType type1() {
		return NodeType.QUERY;
	}

	@Override
	NodeType type2() {
		return NodeType.USER;
	}

}
